import { VOTE_SUP, VOTE_OPP, SAGA_TYPE } from '../actionTypes'

const delay = (time) => {
	return new Promise(resolve => {
		setTimeout(() => {
			resolve()
		}, time)
	})
}

const voteAction = {
	voteSup: () => ({ type: VOTE_SUP }),
	voteOpp: () => ({ type: VOTE_OPP }),
	asyncVoteSup: (payload) => {
		return { type: VOTE_SUP + SAGA_TYPE, payload }
	},
	asyncVoteOpp: (payload) => {
		return { type: VOTE_OPP + SAGA_TYPE, payload }
	}
}

export default voteAction